const koa = require("koa");
const router = require("koa-router")();
const app = new koa();
const koaBody = require("koa-body")
router.get("/search",async ctx=>{
    console.log(ctx.query);
    ctx.body = {
        code:200,
        msg:"search"
    }
})
router.post("/login",async ctx=>{
    console.log(ctx.request.body);
    ctx.body = {
        code:200,
        msg:"登录"
    }
})
app.use(koaBody());
app.use(router.routes());
app.listen(4002)